#include "fabriquedefense.h"
#include"lancepierre.h"
#include"pistolet.h"
#include"musicien.h"
#include"paintball.h"
#include"petanque.h"

Defense* FabriqueDefense::methodeFabrication(QString e, float i, float j){
    float t1= 0.1875;
    Defense *defense = NULL;
    if (e=="pistolet")
       defense = new Pistolet(i,j);
    else if (e=="lancepierre")
        defense = new LancePierre(i,j);
    else if (e=="paintball")
        defense = new PaintBall(i,j);
    else if (e=="petanque")
        defense = new Petanque(i,j);
    else if (e=="musicien")
        defense = new Musicien(i,j);
    defense->setPos(i*(600/16),j*(600/16));
    defense->setScale(t1);
    defense->setZValue(1);


    return (defense);

    /*Utilisation  :  Defense * d= FabriqueDefense::methodeFabrication("lancepierre", 20, 20);
    addItem(d);*/
}
